// export function debounce (fn, delay) {
//   let timer = null
//   return function () {
//     let arg = arguments
//     clearTimeout(timer)
//     timer = setTimeout(() => {
//       fn.apply(this, arg)
//     }, delay)
//   }
// }
export default {
  install(Vue){
    Vue.prototype.debounce = function debounceFn(fn,delay){
      let timer = null
      return ()=>{
        clearTimeout(timer)
        timer = setTimeout(()=>{
          fn()
        },delay)
      }
    }
  }

}




